package view.Professeurs;

import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;

import view.Fenetre;

public class ProfPage {

	private UpPanel up;
	private LeftPanel left;
	public static CenterPanel center;
	private RightPanel right;

	public ProfPage() {

		// Agencement des conteneurs
		GridBagConstraints constraint = new GridBagConstraints();
		Fenetre.fen.setLayout(new GridBagLayout());

		// Creation des conteneurs
		up = new UpPanel();							// Panneau de titre
		left = new LeftPanel();						// Panneau de liste des etudiants
		center = new CenterPanel();					// Panneau de travail
		right = new RightPanel();					// Panneau des demandes d'inscriptions des etudiants


		// CONTRAINTE DU PANNEAU DE TITRE

		constraint.gridx = 1;
		constraint.gridy = 0;

		constraint.weightx = 1.0;
		constraint.weighty = GridBagConstraints.NONE;

		constraint.fill = GridBagConstraints.BOTH;

		constraint.gridwidth = GridBagConstraints.REMAINDER;
		constraint.gridheight = 5;

		Fenetre.fen.add(up, constraint);


		// CONTRAINTE DU PANNEAU DE LISTE DES ETUDIANTS

		constraint.gridx = 1;
		constraint.gridy = 5;

		constraint.weightx = GridBagConstraints.NONE;
		constraint.weighty = 0.95;

		constraint.fill = GridBagConstraints.BOTH;

		constraint.gridwidth = 20;
		constraint.gridheight = 95;

		Fenetre.fen.add(left, constraint);


		// CONTRAINTE DU PANNEAU DE TRAVAIL

		constraint.gridx = 21;
		constraint.gridy = 5;

		constraint.weightx = 0.6;
		constraint.weighty = 0.95;

		constraint.fill = GridBagConstraints.BOTH;

		constraint.gridwidth = 60;
		constraint.gridheight = 95;

		Fenetre.fen.add(center, constraint);


		// CONTRAINTE DU PANNEAU DES INSCRIPTIONS

		constraint.gridx = 81;
		constraint.gridy = 5;

		constraint.weightx = GridBagConstraints.NONE;
		constraint.weighty = 0.95;

		constraint.fill = GridBagConstraints.BOTH;

		constraint.gridwidth = 20;
		constraint.gridheight = 95;

		Fenetre.fen.add(right, constraint);

		// FIN DES CONTRAINTES


		// Mise a jour de la fenetre
		Fenetre.fen.validate();

	}

	/**Vide la fenetre professeur.**/
	public void erase() {

		Fenetre.fen.remove(up);
		Fenetre.fen.remove(left);
		Fenetre.fen.remove(center);
		Fenetre.fen.remove(right);

		Fenetre.fen.validate();

	}

}
